<template>
  <view>
    <u-sticky>
      <u-table>
        <u-tr class="u-tr">
          <u-th class="u-th">洗衣店ID</u-th>
          <u-th class="u-th">洗衣店名称</u-th>
          <u-th class="u-th">洗衣店位置</u-th>
        </u-tr>

        <u-tr class="u-tr" v-for="(item, index) in laundrylist" :key="index">
          <u-td class="u-td">{{ item.id }}</u-td>

          <u-td class="u-td">{{ item.name }}</u-td>
          <u-td class="u-td">{{ item.address }}</u-td>
        </u-tr>
      </u-table>
    </u-sticky>
  </view>
</template>

<script>
export default {
  data() {
    return {
      laundrylist: [],
    };
  },
  methods: {
    // 获取洗衣店列表
    getList() {
      uni.request({
        url: "http://gxyckf.1qit.com/api/admin.clear/getClearStorelist", //仅为示例，并非真实接口地址。
        data: {},
        header: {
          token: uni.getStorageSync("token"),
        },
        success: (res) => {
          console.log(res.data.data);
          this.laundrylist = res.data.data;
        },
      });
    },
  },
  mounted() {
    this.getList();
  },
};
</script>

<style scoped>
.u-th {
  width: 33.33%;
}
.u-td {
  width: 33.33%;
}
</style>
